<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改厂家产品下单时费用')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-afterProductMoney-edit" th:object="${zsyhAfterProductMoney}">
            <input id="productId" name="productId" class="form-control" type="hidden">
            <input id="serviceTypeId" name="serviceTypeId" class="form-control" type="hidden">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">产品信息：</label>
                <div class="col-sm-8">
                    <input id="productName" name="productName" th:field="*{productName}" class="form-control" type="text" onclick="chooseProduct()">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">服务分类：</label>
                <div class="col-sm-8">
                    <input id="serviceTypeName" name="serviceTypeName" th:field="*{serviceTypeName}" class="form-control" type="text" onclick="chooseServiceType()">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">下单费用 厂家：</label>
                <div class="col-sm-8">
                    <input name="factoryMoney" th:field="*{factoryMoney}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">下单费用 师傅：</label>
                <div class="col-sm-8">
                    <input name="repairMoney" th:field="*{repairMoney}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">冻结金额：</label>
                <div class="col-sm-8">
                    <input name="frozenMoney" th:field="*{frozenMoney}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/afterProductMoney";
        $("#form-afterProductMoney-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-afterProductMoney-edit').serialize());
            }
        }

        function chooseProduct() {
            var url =  ctx + "zsyh/afterProduct/productView";
            layer.open({
                type: 2,
                area: ['1000px', '700px'],
                fix: false,
                //不固定
                maxmin: true,
                shade: 0.3,
                title: "选择产品",
                content:  url,
                /*closeBtn:true,*/
                // 弹层外区域关闭
                shadeClose: true,
                end: function(){
                    //location.reload();
                },
                cancel: function(index) {
                    //location.reload();
                }
            });
            /*$.modal.open("选择客户", ctx + "warehouse/address/addressView");*/

        }

        function chooseServiceType() {
            layer.open({
                type: 2,
                area: ['380px', '700px'],
                fix: false,
                //不固定
                maxmin: true,
                shade: 0.3,
                title: "选择位置",
                content:  ctx + "zsyh/afterServiceType/selectAfterServiceTypeTree1/",
                closeBtn: 1,
                // 弹层外区域关闭
                shadeClose: true,
                end: function(){
                    //location.reload();
                },
                cancel: function(index) {
                    //location.reload();
                }
            });

        }

    </script>
</body>
</html>